﻿@page
@using WXWorkSvc.Common.Extensions;
@inject WXWork3rd wx;
@model WXWorkSvc.Third.Areas.D.Pages.User.EditModel
@{
    ViewData["Title"] = "编辑";
}
<nav aria-label='breadcrumb'>
    <ol class='breadcrumb'>
        <li class='breadcrumb-item'><a asp-page="./Index">用户</a></li>
        <li class='breadcrumb-item active' aria-current='page'>@ViewBag.Title</li>
    </ol>
</nav>
<desk-detail asp-for-1="Item.UserName" asp-for-2="Item.UserId" />

<form method="post">
    <input type="hidden" asp-for="Item.UserId" />

    <fieldset class="row mb-3">
        <legend class="col-form-label col-sm-2 pt-0">角色</legend>
        <div class="col-sm-10">
            @for (var i = 0; i < Model.Items.Count; i++)
            {
                <input type="hidden" asp-for="Items[i].Key" />
                <div class="form-check">
                    <input class="form-check-input" type="checkbox" asp-for="Items[i].Value">
                    <label class="form-check-label" for="@($"Items_{i}__Value")">
                        @Html.DisplayFor(model => model.Items[i].Name)
                    </label>
                </div>
            }
        </div>
    </fieldset>
    <desk-buttons asp-link-text-1="保存" asp-link-type-1="Common.Models.EButtonType.Primary"
                  asp-link-text-2="取消" asp-page-2="./Index" />
</form>
@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
    @Html.Raw(await wx.GetAgentJsConfigAsync(Request, User.GetCorpId()))
}
